home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / misc / splines.lha / Splines / popmenu.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-14  |  2.1 KB  |  48 lines

  1. /* The routines in this file are copyright (c) 1987 by Helene (Lee) Taran.
  2.  * Permission is granted for use and free distribution as long as the
  3.  * original author's name is included with the code.
  4.  */
  5.  
  6. #ifndef POPUP_MENU_H
  7. #define POPUP_MENU_H
  8.  
  9.  
  10. /* The following constants are the font characteristics of topaz eight :
  11.  * If you want a different font, you'll have to open it in the Init_MenuPackage
  12.  * and set these constants to the appropriate values.
  13.  */
  14. #define FONT_HEIGHT   8   /* pixel height of an average character */
  15. #define FONT_WIDTH    8   /* pixel width of an average character */
  16. #define FONT_BASELINE 6   /* relative pixel location of character baseline */
  17.  
  18. #define MAX(a,b) ((a > b) ? a : b)
  19.  
  20. #define NOITEM_SELECTED 0  /* returned from PopUp if no item was selected */
  21. #define OUTSIDE_WINDOW -1  /* returned from PopUp if cursor outside of window */
  22.  
  23. typedef struct PopUp_Item {
  24.    char *text;                 /* text string to be displayed */
  25.    SHORT selection_id;             /* id returned when this item is selected */
  26.    SHORT left, top;              /* top/left offset within menu */
  27.    SHORT height,width;           /* desired height/width of selection box */
  28.    UBYTE color;                  /* desired text color (= color register) */
  29.    struct PopUp_Item *next;      /* link to next menu item */
  30. } SPL_POPUP_ITEM;
  31.  
  32. typedef struct PopUp_Menu {
  33.    SHORT depth;                     /* number of bit-planes to use */
  34.    SHORT left,top, height;          /* used internally */
  35.    SHORT width;                  /* desired width of menu */
  36.    USHORT deactivate;               /* what MOUSEBUTTON deactives the menu */
  37.    UBYTE outline_color, area_color; /* color registers */
  38.    CLIPRECT cr;              /* clipping rectangle for display */
  39.    RASTPORT rp;              /* raster port for drawing into menu area */
  40.    BITMAP bitmap;            /* actual bitmap for rendering the menu */
  41.    SPL_POPUP_ITEM *first_item;   /* first in list of menu items */
  42.    SPL_POPUP_ITEM *active_item;  /* for internal use only */
  43. } SPL_POPUP_MENU;
  44.  
  45.  
  46. #define Inside_Window(x,y,w)(((x)>0)&&((x)<(w)->Width)&&((y)>0)&&((y)<(w)->Height))
  47. #endif
  48.